const parser = require('@babel/parser')
const {transformFromAstSync} = require("@babel/core")
//es6 => es5
module.exports = function(source){
  
  const ast = parser.parse(source,{sourceType:"module"})

  const { code } = transformFromAstSync(ast,null,{
    presets:["@babel/preset-env"]
  })
  // console.log(code)
  return source;
}